#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/7/15 13:51
# @Author  : CoderCharm
# @File    : views.py
# @Software: PyCharm
# @Github  : github/CoderCharm
# @Email   : wg_python@163.com
# @Desc    :
"""

用户视图

# """
# import time
#
from sqlalchemy.orm import Session
from api.common import deps
from fastapi import APIRouter, Depends
from api.api_v1.api_set.schemas import api_set_schema
from api.utils import response_code

# from api.api_v1.api_set.crud.api_set import curd_api_set
# from api.api_v1.project.crud.project import curd_project
from .crud.project import curd_project
from .crud.api_set import curd_api_set

router = APIRouter()


@router.get("/get/api_set", summary="获取接口")
async def permission(
        db: Session = Depends(deps.get_db),
        project_id=int
):
    response = curd_api_set.query_all(db=db, project_id=project_id)
    return response_code.resp_200(message="获取接口成功", data=response)


@router.get("/get/api", summary="获取接口")
async def permission(
        db: Session = Depends(deps.get_db),
):
    response = curd_project.query_all(db=db)
    return response_code.resp_200(message="获取接口成功", data=response)
